//
//  SeriesObject.m
//  ArandaTest
//
//  Created by Camilo Cadena on 2/18/15.
//  Copyright (c) 2015 Camilo Cadena. All rights reserved.
//

#import "SeriesObject.h"

@implementation SeriesObject

@synthesize backdrop_path;
@synthesize series_id;
@synthesize original_name;
@synthesize first_air_date;
@synthesize origin_country;
@synthesize poster_path;
@synthesize popularity;
@synthesize name;
@synthesize vote_average;
@synthesize vote_count;

+ (SeriesObject *)instanceFromDictionary:(NSDictionary *)aDictionary{
    SeriesObject *instance = [[SeriesObject alloc] init];
    [instance setAttributesFromDictionary:aDictionary];
    return instance;
}

- (void)setAttributesFromDictionary:(NSDictionary *)aDictionary {
    
    if (![aDictionary isKindOfClass:[NSDictionary class]]) {
        return;
    }
    
    [self setValuesForKeysWithDictionary:aDictionary];
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"id"]) {
        [self setValue:value forKey:@"series_id"];
    }
    
}


@end